package com.monster.valid.annotation;
import com.monster.valid.validated.IdCardValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * 身份证校验
 * @author kuangxz
 */
@Target({ElementType.FIELD,ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy = {IdCardValidator.class})
public @interface ValidIdCard {
    String name() default "";
    /**
     * 提示信息
     * @return 默认提示信息
     */
    String message() default "";

    /**
     * 校验分组
     * @return 分组的class数组
     */
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};

    /**
     * 是否可以为空
     * @return true/false
     */
    boolean isNull() default true;
}
